package org.testmyapp.entities;

public class ClaimDisqualifictationPk {

	private TariffInstancePk tariffInstance;
	private Integer claim;
	
	public ClaimDisqualifictationPk() {

	}

	public ClaimDisqualifictationPk(TariffInstancePk tariffInstance, int claim) {
		this.tariffInstance = tariffInstance;
		this.claim = claim;
	}

	@Override
	public boolean equals(Object other) {
		if (other == null) {
			return false;
		}
		if (!other.getClass().equals(this.getClass())) {
			return false;
		}
		ClaimDisqualifictationPk otherObject = (ClaimDisqualifictationPk) other;
		if (otherObject == this) {
			return true;
		}
		if (tariffInstance != null && otherObject.tariffInstance != null
				&& tariffInstance.equals(otherObject.tariffInstance)) {
			if (claim != null && otherObject.claim != null
					&& claim.equals(otherObject.claim)) {
				return true;
			}
		}
		return false;
	}
	
	@Override
	public int hashCode() {
		if(tariffInstance == null || claim == null) {
			return 0;
		}
		else {
			return tariffInstance.hashCode() ^ claim.hashCode();
		}
	}
	
}
